<?php

namespace LowCode\Traits\Props;

use LowCode\Support\JsExp;

/**
 * 属性placement
 */
trait HasPlacement
{
    /**
     * 属性placement
     * @param string|JsExp $placement
     * @return $this
     */
    public function placement(string|JsExp $placement = 'top' | 'right' | 'bottom' | 'left'): static
    {
        return $this->prop("placement",$placement);
    }

    /**
     * top placement
     * @return $this
     */
    public function placementTop(): static
    {
        return $this->placement('top');
    }

    /**
     * right placement
     * @return $this
     */
    public function placementRight(): static
    {
        return $this->placement('right');
    }

    /**
     * bottom placement
     * @return $this
     */
    public function placementBottom(): static
    {
        return $this->placement('bottom');
    }

    /**
     * left placement
     * @return $this
     */
    public function placementLeft(): static
    {
        return $this->placement('left');
    }
}
